public class UserTest {
    public static void main(String[] args) {
        User user = new User();
        System.out.println(user.getName());
        System.out.println(user.getAge());


        //获取User的Class对象
        Class<?> userClass = User.class;

        //判断Class对象上是否有 SystemConfig 的注解
        if (userClass.isAnnotationPresent(SystemConfig.class)) {
            System.out.println("User上配置了SystemConfig注解");

            //获取SystemConfig注解
            SystemConfig config = userClass.getAnnotation(SystemConfig.class);
            System.out.println("SystemConfig.name:" + config.name() + "; SystemConfig.age:" + config.age());
        } else {
            System.out.println("User上没有配置 SystemConfig 注解");
        }
    }
}
